from vector import *
import rendering
import entityManager
class Camera:
    def __init__(self,pos):
        entityManager.entityList.append(self)
        self.pos = pos
        self.size = (640,480)
    def think(self):
        for obj in rendering.objects:
            self.p = vector(obj.getPos()[0]-self.pos.get()[0],obj.getPos()[1]-self.pos.get()[1])
            if self.p.get()[0] <= self.size[0] and self.p.get()[1] <= self.size[1]:
                obj.setPos(self.p)
                obj.draw()
    def setPos(self,vec):
        self.pos = vec
